package com.njwb.day15.zqzb.method;

import com.njwb.day15.zqzb.method.review.Person;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Method03 {
    public static void main(String[] args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {

            Method m = Person.class.getDeclaredMethod("hello1",int.class);
            m.invoke(Person.class,123);
            m.invoke(null,456);
            m.invoke(new Person(),789);

            //调用 (静态方法，类，对象)
//            Person.hello1(1);
//            Person p = new Person();
//            p.hello1(123);

    }
}
